#include "mexamquestions.h"

MExamQuestions::MExamQuestions(QObject *parent) 
    : QObject(parent)
{
     
}

void MExamQuestions::add()
{
    int a=10,b=0,c=0,d=0;
    a = 5;
    b=a++;
    c=++a;
    d=10*a++;
    printf("\nadd===a,b,c,d: %d,%d,%d,%d",a,b,c,d);
    fflush(stdout);
}

void MExamQuestions::numSwitch()
{
    
    int t1=2,t2=3;
    printf("\n==111------t1=%d,t2=%d",t1,t2);
    t1 = t1+t2;
    t2 = t1 - t2;
    t1 = t1-t2;
    printf("\n==222-----t1=%d,t2=%d",t1,t2);
    fflush(stdout);
}

void MExamQuestions::bitSwitch()
{
    char c1=70;
    char c2 = c1<<4;
    char c3 = c1>>4;
    printf("\nc1=%d,c2=%d,c3=%d,d=%d",c1,c2,c3,c2+c3);
    fflush(stdout);
}
